package org.familysearch.fsapi.gwt.server.bo;

import org.familysearch.fsapi.gwt.server.dao.DAOException;
import org.familysearch.fsapi.gwt.server.dao.DAOFactory;
import org.familysearch.fsapi.gwt.server.dao.IdentityDAO;
import org.familysearch.fsapi.gwt.server.dao.Session;

public class IdentityBO {

	private DAOFactory daoFactory = DAOFactory.instance(DAOFactory.REST);
	private IdentityDAO identityDAO;
		
	public IdentityBO()
	{
		identityDAO = daoFactory.getIdentityDAO();
	}
	
	public Session initializeSession() throws BOException
	{
		
		Session session = null;
		try
		{
			session = identityDAO.authenticate();
		}
		catch(DAOException e)
		{
			throw new BOException("oops", "bad");
		}
		return session;
	}

}
